Skip to content

fix(session): use guarded mktemp template and cleanup in smoke test - #1276

Merged
tieubao merged 1 commit into
masterfrom
fix/smoke-mktemp-template-guard
Dec 5, 2026
Merged

tieubao merged 1 commit into
masterfrom
fix/smoke-mktemp-template-guard

Conversation

@tieubao

@tieubao tieubao commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator
  • Verdict: Fixed lib/session/observe/tests/smoke.sh:132 to satisfy tests/test-mktemp-template-guard.sh (rules R1 and R3) and clean up $stub on exit and completion.
  • Proof: bash tests/test-mktemp-template-guard.sh flipped from red (10 passed, 1 failed) to green (11 passed, 0 failed), bash lib/session/observe/tests/smoke.sh passed all 120 checks with zero leftover stub dirs, and bash tests/run-all.sh --changed origin/master --time passed all 13 suites.
  • Risk: Low, scoped to a single test script (lib/session/observe/tests/smoke.sh) plus its verification log; rollback is a clean revert.
  • Needs Han: Review and merge once GitHub Actions checks are green.

What

Master CI runs #1287 and #1288 failed test-mktemp-template-guard because lib/session/observe/tests/smoke.sh:132 (added in PR #1275) used bare stub="$(mktemp -d)" without an explicit ${TMPDIR:-/tmp} template, failure guard, or cleanup. Replaced line 132 with stub="$(mktemp -d "${TMPDIR:-/tmp}/session-observe-smoke.XXXXXX")" || exit 1, registered trap 'rm -rf "${stub:-}"' EXIT, and added rm -rf "$stub" after case [30b].

Demo

Red before (origin/master b6c9545b):

$ bash tests/test-mktemp-template-guard.sh
=== G1: the live tree has no bare mktemp and no unguarded test use ===
  PASS scanned 877 files
  FAIL violations:
R1 lib/session/observe/tests/smoke.sh:132: stub="$(mktemp -d)"
=== G2: negative control, each rule fires on a planted line ===
  PASS caught R1 lib-bad.sh:1:
  PASS caught R1 lib-bad.sh:2:
  PASS caught R1 lib-bad.sh:3:
  PASS caught R1 lib-bad.sh:4:
  PASS caught R1 lib-bad.sh:5:
  PASS caught R1 lib-bad.sh:6:
  PASS caught R2 tests/test-bad.sh:1:
  PASS caught R3 tests/test-bad.sh:2:
=== G3: the accepted forms stay clean ===
  PASS accepted forms produce no violation

=== 10 passed, 1 failed ===

Green after (fix/smoke-mktemp-template-guard):

$ bash tests/test-mktemp-template-guard.sh
=== G1: the live tree has no bare mktemp and no unguarded test use ===
  PASS scanned 877 files
  PASS no violations
=== G2: negative control, each rule fires on a planted line ===
  PASS caught R1 lib-bad.sh:1:
  PASS caught R1 lib-bad.sh:2:
  PASS caught R1 lib-bad.sh:3:
  PASS caught R1 lib-bad.sh:4:
  PASS caught R1 lib-bad.sh:5:
  PASS caught R1 lib-bad.sh:6:
  PASS caught R2 tests/test-bad.sh:1:
  PASS caught R3 tests/test-bad.sh:2:
=== G3: the accepted forms stay clean ===
  PASS accepted forms produce no violation

=== 11 passed, 0 failed ===
$ bash lib/session/observe/tests/smoke.sh
...
[30b] session-semantic: the default command asks for Haiku (stub claude on PATH)
  ok: default command pins --model haiku
...
smoke: all 120 passed

Isolated TMPDIR cleanup check confirmed zero session-observe-smoke.* directories left behind after smoke.sh exits.

Proof

docs/verification/smoke-mktemp-template-guard.md

Bookkeeping

no-board-row: CI failure fix for bare mktemp in smoke.sh introduced by PR #1275

Replace bare mktemp -d at lib/session/observe/tests/smoke.sh:132 with an explicit TMPDIR template and failure guard (rules R1 and R3 of test-mktemp-template-guard), and remove the temporary stub directory on exit and test completion.
@tieubao

tieubao commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

independent-check (failed at d41c6781)

  • Verdict: fail (verifier timed out after 300s)
  • Proof: fresh-context claude re-run at d41c678172a5fc45ffce72fc9993c041bda78df0 (306.2s)
  • Risk: Fix proof or code, push, and re-run independent-check run consolelabs/devkit#1276.

Commands run:

  • (no proof command executed)

@tieubao
tieubao merged commit 9fb8b07 into master Dec 5, 2026
9 checks passed
@tieubao
tieubao deleted the fix/smoke-mktemp-template-guard branch December 5, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant